/**

function IdFn (arg: string): string {
  return arg
}

function IdFn2 (arg: number): number {
  return arg
}

function IdFn3 (arg: { name: string; age: number }): {
  name: string
  age: number
} {
  return arg
}
 */

// 上面写的这些，只能满足某一个类型，达不到我想要的所有类型
function IdFn<T> (arg: T): T {
  return arg
}

const res1 = IdFn<string>('你好')
console.log('---res1---', res1)

const res2 = IdFn<number>(123)
console.log('---res2---', res2)

const res3 = IdFn<{ name: string; age: number }>({ name: '李琦', age: 29 })
console.log('---res3---', res3)
